import * as express from "express"
import { OperationObject } from 'swagger-express-middleware'

export interface ControllerMetadata {
    path: string;
    middleware: express.RequestHandler[];
    target: any;
}

export interface ControllerMethodMetadata extends ControllerMetadata {
    method: string
    key: string
    swagger?: OperationObject
    followHandler?: express.ErrorRequestHandler[]
}

export interface IController { }

export interface HandlerDecorator {
    (target: any, key: string, descriptor: any): void;
}

export interface ConfigFunction {
    (app: express.Application): void;
}

export interface ControllerRouteInfo extends ControllerMetadata {
    methods: ControllerMethodMetadata[]
}